package com.daka.vo.response;

import com.daka.entity.AuctionTradeList;
import com.daka.entity.Goods;
import lombok.Data;
import lombok.ToString;
import org.apache.ibatis.type.Alias;

import java.math.BigDecimal;
import java.util.Date;


@Data
@ToString
public class MyAuctionVo {

    private Long id;

    private String code;

    private Long goods;

    private String goodsName;

    private String goodsCode;

    private BigDecimal amount;

    private Long user;

    private Long team;

    private Integer auctionStatus;

    private Integer payStatus;

    private Integer payType;

    private Date createTime;

    private Integer payFlag;

    // 10 被超（出价不是最高） 20 最高（出价最高&未开始支付） 30 未支付（出价最高&开始支付&支持线上支付） 40 明拍商品（出价最高&开始支付&不支持线上支付） 50 完成（支付完成）
    private Integer showStatus;

    public static MyAuctionVo build(AuctionTradeList auctionTradeList,Goods goods,Integer showStatus){
        MyAuctionVo result = new MyAuctionVo();
        result.setAmount(auctionTradeList.getAmount());
        result.setAuctionStatus(auctionTradeList.getAuctionStatus());
        result.setCode(auctionTradeList.getCode());
        result.setCreateTime(auctionTradeList.getCreateTime());
        result.setGoods(auctionTradeList.getGoods());
        result.setGoodsName(goods.getName());
        result.setPayFlag(auctionTradeList.getPayFlag());
        result.setPayStatus(auctionTradeList.getPayStatus());
        result.setPayType(auctionTradeList.getPayType());
        result.setTeam(auctionTradeList.getTeam());
        result.setUser(auctionTradeList.getUser());
        result.setId(auctionTradeList.getId());
        result.setShowStatus(showStatus);
        result.setGoodsCode(goods.getCode());
        return result;
    }
}